home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / ca29_4.zip / CACMP.DOC next >
Text File  |  1992-11-30  |  21KB  |  880 lines

  1. COM-AND Script Utility
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.           ---------------------------------------
  13.                COM-AND Script Utility
  14.           Script utility for the COM-AND language
  15.           ---------------------------------------
  16.  
  17.  
  18.  
  19.  
  20.     CACMP ver.1.2 and COM-AND are copyright by 1992 CABER Software.
  21.     CACMP and COM-AND are distributed freely and may be copied by
  22.     anyone for any number of machines, for purposes of evaluation.
  23.     The author offers COM-AND and its accessory programs together
  24.     as "shareware".  If you USE the program you MUST pay for it.
  25.  
  26.  
  27.  
  28.     The complete user license and registration information is to be
  29.     found in the file REGISTER.DOC.  Limitations on redistribution
  30.     of COM-AND are set out in the file VENDOR.DOC.    These two files
  31.     are included with the COM-AND program release.
  32.  
  33.  
  34.  
  35.                  CABER Software
  36.                  R. (Scott) McGinnis
  37.                  P.O. Box 3607 Mdse Mart
  38.                  Chicago, IL 60654-0607
  39.  
  40.                  GEnie, Delphi: TARTAN
  41.                  CIS .......... 73147,2665
  42.                  Internet ..... 73147.2665@compuserve.com
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54. Version 1.2: 921012
  55.  
  56. COM-AND Script Utility
  57.  
  58.  
  59.                  Table of Contents
  60.                  -----------------
  61.  
  62. I.    Introduction  .............................................. page 1
  63.  
  64. II.    Running CACMP  ............................................. page 2
  65.  
  66. III.    CACMP functions ............................................ page 4
  67.  
  68.     A. Syntax check ............................................ page 4
  69.     B. Semantic check .......................................... page 5
  70.     C. Partial strip ........................................... page 9
  71.     D. Full strip .............................................. page 10
  72.     E. Preprocessing ........................................... page 11
  73.  
  74.  
  75. IV.    CACMP and COM-AND .......................................... page 12
  76.  
  77. V.    Program Requirements ....................................... page 13
  78.  
  79. VI.    Program and Author Information    ............................ page 14
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109. Version 1.2: 921012
  110.  
  111. COM-AND Script Utility                           Page   1
  112.  
  113.  
  114. I.    Introduction
  115.  
  116.  
  117.     A. What is COM-AND?
  118.  
  119.        COM-AND for the IBM PC and compatibles is a communications pro-
  120.        gram for use by itself, or with several integrated accessory
  121.        programs (which themselves may be used independently of COM-AND).
  122.        COM-AND provides standard comm program functions:  a dialing
  123.        directory, macros, disk logging, binary and ASCII file transfers,
  124.        ... and scripted execution.
  125.  
  126.  
  127.     B. COM-AND scripts
  128.  
  129.        A script automates certain manual tasks, and allows COM-AND to
  130.        run unattended (if the script has been tested (!!!)).  A script
  131.        is a program written to control COM-AND execution.  Scripts
  132.        distributed with COM-AND include:  LEARN mode (a script that
  133.        writes a script), a FILEMGR (perform DOS functions and find
  134.        files for transmission), a BBS, a HOST mode, and many more.
  135.  
  136.  
  137.        Script commands are read by COM-AND from an ASCII file (word
  138.        processor files are not usually ASCII files (!)).  COM-AND's
  139.        internal editor (Alt-Q), programmer's text editors and EDLIN
  140.        (included with DOS) may be used to create and modify a script
  141.        file.
  142.  
  143.  
  144.  
  145.     C. The CACMP program
  146.  
  147.        CACMP is a diagnostic and preprocessor for COM-AND scripts.
  148.        CACMP may be used simply to perform syntax and semantic review
  149.        of a COM-AND script, or it may be used to preprocess scripts
  150.        for COM-AND.
  151.  
  152.  
  153.        This document discusses the use of CACMP.EXE.  COM-AND scripts
  154.        and the script language are discussed in the CASCRIPT.DOC
  155.        document, distributed with COM-AND.
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164. Version 1.2: 921012
  165.  
  166. COM-AND Script Utility                           Page   2
  167.  
  168.  
  169. II.    Running CACMP
  170.  
  171.  
  172.     Generally, CACMP is invoked at the DOS prompt with the command:
  173.  
  174.     -----------------------------------------------------------------
  175.     "d>" CACMP <options> [<infilename> [<outfilename>]]
  176.  
  177.     Where "d>" is the DOS prompt, and
  178.           <options> are [<switch> [<switch> ...]]
  179.     -----------------------------------------------------------------
  180.  
  181.  
  182.     CACMP could be invoked with a command such as:
  183.  
  184.         "d>" CACMP
  185.  
  186.     to simply start CACMP.    In this case, CACMP prompts for an input
  187.     file and does not write a stripped/preprocessed file.  The command:
  188.  
  189.         "d>" CACMP /s
  190.  
  191.     causes CACMP to prompt for both an input AND an output file name
  192.     (the input file MUST NOT be the same as the output file).  Output
  193.     is the input stripped of comments (see below).
  194.  
  195.  
  196.     CACMP by default deletes an output file (if there is one) when a
  197.     syntax error is found.    This action may be inhibited with the switch
  198.     "/k".  In the case:
  199.  
  200.         "d>" CACMP /s/k
  201.  
  202.     the output file is retained (and lines marked as 'syntax errors'
  203.     are retained (partially stripped, regardless of preprocessing).
  204.  
  205.  
  206.     The input file name (and output file name) may be specified in the
  207.     run command.  For example:
  208.  
  209.         "d>" CACMP /s bbs.src
  210.  
  211.     reads the file BBS.SRC and prompts for an output file name.  Input
  212.     file names default to the extension ".CMD" if the name given is not
  213.     found.    The output file, if it exists, is deleted and recreated when
  214.     CACMP begins.  For this reason, CACMP must not be run with the same
  215.     file as INPUT and output.
  216.  
  217.  
  218.  
  219. Version 1.2: 921012
  220.  
  221. COM-AND Script Utility                           Page   3
  222.  
  223.  
  224. II.    Running CACMP (continued)
  225.  
  226.  
  227.     The following switches are defined for CACMP at run-time:
  228.  
  229.         /1        Partial strip output (see below)
  230.         /s        Full strip output (see below)
  231.         /k        Keep output when syntax error is detected
  232.         /p        Preprocess script (for speed)
  233.  
  234.  
  235.     The default settings for CACMP are: no output, and delete output if
  236.     a syntax error is detected.
  237.  
  238.  
  239.     All error and diagnostic output by CACMP is directed to the standard
  240.     output device.    Therefore, the command:
  241.  
  242.         "d>" CACMP >temp script.cmd
  243.  
  244.     records all the diagnostic information in the file TEMP on the cur-
  245.     rent subdirectory, for later review.
  246.  
  247.  
  248.     When CACMP terminates it displays the following summary:
  249.  
  250.         Total input lines:
  251.         Total input statements:
  252.         Total input comments:
  253.         Total input labels:
  254.         Total syntax errors:
  255.         Total semantic warnings:
  256.  
  257.  
  258.     If CACMP created an output file, CACMP also reports:
  259.  
  260.         Input file size:
  261.         Output file size:
  262.  
  263.  
  264.     CACMP terminates with a DOS error level of 0 if no syntax errors and
  265.     no semantic errors are detected.  CACMP terminates with a DOS error
  266.     level of 1 if either syntax or semantic errors are reported.  [Batch
  267.     checks of a group of scripts may be stopped on an error using the
  268.     error level returned to DOS.]
  269.  
  270.  
  271.  
  272.  
  273.  
  274. Version 1.2: 921012
  275.  
  276. COM-AND Script Utility                           Page   4
  277.  
  278.  
  279. III.    CACMP functions
  280.  
  281.  
  282.     A. Syntax check
  283.  
  284.  
  285.        CACMP's first function is to syntactically verify each line of
  286.        the input file.  Syntax errors are noted as follows:
  287.  
  288.               Line     3: Syntax error
  289.                S0 = N0+5(N1+ N2)
  290.                     ^
  291.               General parse failure (syntax)
  292.  
  293.  
  294.        The first line records the line number and the error.  The second
  295.        line echoes the input line.    The third line points to the highest
  296.        point the parser reached parsing the line (probably close to the
  297.        point at which the error occurs).  The fourth line adds any addi-
  298.        tional information returned by the parser.
  299.  
  300.  
  301.        Developer's note:  In the fourth line, ANY return except the one
  302.        above should be reported to the author.  The fourth line properly
  303.        may be considered diagnostic to CACMP.  For example, 'Stack
  304.        overflow' at this point indicates that the parser recursed beyond
  305.        its stack - a CACMP problem and not an input problem.
  306.  
  307.  
  308.        All error and diagnostic information listed by CACMP is directed
  309.        to the standard output device.  Therefore, the command:
  310.  
  311.            "d>" CACMP >temp script.cmd
  312.  
  313.        records all CACMP diagnostic information in the file TEMP on the
  314.        current subdirectory, for later review.
  315.  
  316.  
  317.        Syntax errors are counted, and the number reported at CACMP ter-
  318.        mination.  If CACMP is used to strip/preprocess a file and syntax
  319.        errors are detected, the output file is deleted (unless /k in
  320.        the run command is specified).
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329. Ve